/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mbos.entities;

import mbos.entities.enums.AccountType;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 *
 * @author mier
 */
@Entity
@Table(name = "account")
public class Account implements Serializable {

    public static final long serialVersionUID = 1l;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    @NotNull
    @Column(name = "emp_fname", nullable = false)
    private String empFName;
    @NotNull
    @Column(name = "emp_lname", nullable = false)
    private String empLName;
    @NotNull
    @Column(name = "emp_mname", nullable = false)
    private String empMName;
    @NotNull
    @Enumerated(EnumType.STRING)
    @Column(name = "position", nullable = false)
    private AccountType acctType;
    @NotNull
    @Column(name = "user_name", unique = true)
    private String userName;
    @NotNull
    @Column(name = "password")
    private String password;
    @NotNull
    @Column(name = "connection_stat")
    private int conStat;
    @NotNull
    @Column(name = "emp_stat")
    private int empStat;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getEmpFName() {
        return empFName;
    }

    public void setEmpFName(String empFName) {
        this.empFName = empFName;
    }

    public String getEmpLName() {
        return empLName;
    }

    public void setEmpLName(String empLName) {
        this.empLName = empLName;
    }

    public String getEmpMName() {
        return empMName;
    }

    public void setEmpMName(String empMName) {
        this.empMName = empMName;
    }

    public AccountType getAcctType() {
        return acctType;
    }

    public void setAcctType(AccountType acctType) {
        this.acctType = acctType;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getConStat() {
        return conStat;
    }

    public void setConStat(int conStat) {
        this.conStat = conStat;
    }

    public int getEmpStat() {
        return empStat;
    }

    public void setEmpStat(int empStat) {
        this.empStat = empStat;
    }

    public Branch getAccountId() {
        return accountId;
    }

    public void setAccountId(Branch accountId) {
        this.accountId = accountId;
    }
    @JoinColumn(name = "branch_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Branch accountId;
}
